/**
 * *************************************
 * Copyright(c)2016 Dingdang Yixia 
 * All Rights Reserved.
 *
 * @File: CustomerMapper.java
 * @Package: com.ddyx.mapper
 * @Description:
 * 
 * @Version: V1.0
 * @Author: Yidong.Xiang
 * @Date: 2017年8月24日 下午12:55:10
 * 
 * *************************************
 */
package com.ddyx.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.ddyx.entity.Customer;

/**
 * @ClassName: CustomerMapper.java
 * @Module: 
 * @Description: 
 * 
 * @author: Yidong.Xiang
 * @date: 2017年8月24日 下午12:55:10
 * 
 */
@MyBatisRepository
public interface CustomerMapper {
    int deleteByPrimaryKey(Integer customerId);

    int insert(Customer record);

    Customer selectByPrimaryKey(Integer customerId);

    List<Customer> selectAll();

    int updateByPrimaryKey(Customer record);
    ///////
    List<Map<String,Object>> findVip(@Param("start")int start
			,@Param("size")int size
			,@Param("filter")String filter);
	
	int countVip(@Param("start")int start
			,@Param("size")int size
			,@Param("filter")String filter);
	
	List<Map<String,Object>> findGuest(@Param("start")int start
			,@Param("size")int size
			,@Param("filter")String filter);

	int countGuest(@Param("start")int start
			,@Param("size")int size
			,@Param("filter")String filter);
	
	int findVipByContactId(@Param("contactId")String contactId);
	
	List<Map<String,Object>> getCustomer(@Param("contactId")String contactId);
	int countCustomer(@Param("faceId")int faceId);
    int updateByCustomerId(Customer record);
//    int updateCustomerById(@Param("customerId")int customerId
//    		, @Param("customerName")String customerName
//    		, @Param("nickname")String nickname
//    		, @Param("gender")String gender
//    		, @Param("email")String email
//    		, @Param("mobile")String mobile
//			, @Param("address")String address
//			, @Param("isvip")int isvip);
//
//    int updateByContactId(@Param("faceId")int faceId
//    		, @Param("contactId")String contactId
//    		, @Param("customerName")String customerName
//    		, @Param("nickname")String nickname
//    		, @Param("gender")String gender
//    		, @Param("email")String email
//    		, @Param("mobile")String mobile
//			, @Param("address")String address
//			, @Param("isvip")int isvip);
    int updateByContactId(Customer customer);
    List<Map<String,Object>> findByCustName(@Param("start")int start
			,@Param("size")int size
			,@Param("customerName")String customerName);
    int hasContact(@Param("contactId")String contactId);
    int updateLastDateArrived(@Param("snapTime")String snapTime,@Param("contactId")String contactId);
    boolean saveHeadImage(@Param("customerId")int customerId,@Param("headImage")String headImage);

}
